from flask import Flask
#导入数据库
from flask_sqlalchemy import SQLAlchemy
#导入flask_script
from flask_script import Manager
#数据库迁移
from flask_migrate import Migrate,MigrateCommand

#导入config
from config import config
app = Flask(__name__)
#设置config中DEBUG
app.config.from_object(config['development'])

db = SQLAlchemy(app)
#实例化启动器
manage = Manager(app)

Migrate(app,db)
manage.add_command('db',MigrateCommand)

@app.route('/')
def index():
    return 'hello world'

if __name__ == '__main__':

    # app.run()
    manage.run()